import xadmin
from django.contrib import admin
#引入model类
from .models import Course, Lesson, Video, CourseResource
# Register your models here.
#课程
class CourseAdmin(object):
	list_display=['name', 'desc', 'detail', 'degree', 'learn_times', 'students']
	search_fields=['name', 'desc', 'detail', 'degree', 'students']
	list_filter=['name', 'desc', 'detail', 'degree', 'learn_times', 'students']
#学时
class LessonAdmin(object):
	list_display=['course', 'name', 'add_time']
	search_fields=['course', 'name']
	list_filter=['course', 'name', 'add_time']
#视频
class VideoAdmin(object):
	list_display=['lesson', 'name', 'add_time']
	search_fields=['lesson', 'name']
	list_filter=['lesson', 'name', 'add_time']
#课程资源
class CourseResourceAdmin(object):
	list_display=['course', 'name', 'download', 'add_time']
	search_fields=['course', 'name', 'download']
	list_filter=['course', 'name', 'download', 'add_time']

xadmin.site.register(Course, CourseAdmin)
xadmin.site.register(Lesson, LessonAdmin)
xadmin.site.register(Video, VideoAdmin)
xadmin.site.register(CourseResource, CourseResourceAdmin)		

		
		
		
